# -*- coding: utf-8 -*-
from __future__ import unicode_literals
 
from django.db import models
#from django.utils.encoding import python_2_unicode_compatible
 
class record_type(models.Model):
    record_type = models.CharField('记录类型', max_length=20, blank=True)

    def __unicode__(self):
        return self.record_type

class line_type(models.Model):
    line_type =  models.CharField('线路类型', max_length=20, blank=True)

    def __unicode__(self):
        return self.line_type

class dnspod_info(models.Model):
    host_record = models.CharField('主机记录', max_length=20, blank=True)
    record_type = models.ForeignKey(record_type)
    line_type = models.ForeignKey(line_type)
    record_value = models.CharField('记录值', max_length=200, blank=True)
    TTL = models.CharField('TTL', max_length=20, blank=True)
    status = models.CharField('状态', max_length=20, blank=True)#启用/暂停

    def __unicode__(self):
        return self.record_value

    class Meta:
        verbose_name = '节点名称'
        verbose_name_plural = '节点名称'
        ordering = ['host_record']  # 按照哪个栏目排序

